package com.jsu.clubmanagementsystem.service.activity;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsu.clubmanagementsystem.common.PageQueryRequest;
import com.jsu.clubmanagementsystem.model.dto.activity.ActivityQueryRequest;
import com.jsu.clubmanagementsystem.model.dto.activitymembership.ActivityMembershipQueryRequest;
import com.jsu.clubmanagementsystem.model.entity.Activity;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jsu.clubmanagementsystem.model.entity.ActivityMembership;
import com.jsu.clubmanagementsystem.model.vo.activity.ActivityVO;
import com.jsu.clubmanagementsystem.model.vo.activity.ListActivityVO;
import com.jsu.clubmanagementsystem.model.vo.user.UserVO;

import java.util.List;

/**
 * @author 24753
 * @description 针对表【activity(社团活动)】的数据库操作Service
 * @createDate 2025-05-13 17:19:17
 */
public interface ActivityService extends IService<Activity> {

    /**
     * 增加活动
     * @param activity
     * @return
     */
    long addActivity(Activity activity);

    /**
     * 取消活动
     *
     * @param activity
     * @return
     */
    boolean deleteActivity(Activity activity);

    /**
     * 更新活动
     * @param activity
     * @return
     */
    boolean updateActivity(Activity activity);

    /**
     * 添加成员到活动
     *
     * @param membership
     * @return
     */
    boolean addMemberToActivity(ActivityMembership membership);

    /**
     * 从活动中移除成员
     *
     * @param membership
     * @return
     */
    boolean deleteMemberFromActivity(ActivityMembership membership);

    /**
     * 获取封装对象
     * @param activity
     * @return
     */
    ActivityVO getActivityVO(Activity activity);

    /**
     * 获取封装对象 (分页)
     * @param page
     * @return
     */
    Page<ActivityVO> getActivityVoPage(Page<Activity> page);

    /**
     * 查看活动成员表
     *
     * @param queryRequest
     * @return
     */
    Page<UserVO> listUserVoInActivityByPage(ActivityMembershipQueryRequest queryRequest);


    /**
     * 查看用户参加过的活动
     *
     * @param queryRequest
     * @return
     */
    Page<ActivityVO> listActivityVoOfUserByPage(ActivityMembershipQueryRequest queryRequest);

    /**
     * 获取查询封装
     *
     * @param queryRequest
     * @return
     */
    QueryWrapper<Activity> getQueryWrapper(ActivityQueryRequest queryRequest);

    /**
     * 获取目标社团的活动列表
     *
     * @param clubId
     * @return
     */
    List<Activity> getActivityListOfClub(Long clubId);

    /**
     * 获取目标用户参加的活动
     *
     * @param userId
     * @return
     */
    List<Activity> getActivityListOfUser(Long userId, Long activity);

    /**
     * 活动是否存在
     *
     * @param activityId
     * @return
     */
    boolean isExist(Long activityId);

    /**
     * 集合中的活动是否都已结束
     *
     * @param activityList
     * @return
     */
    boolean isActivitiesAllEnd(List<Activity> activityList);

    /**
     * 验证参数
     *
     * @param activity
     * @param isAdd
     */
    void activityValidation(Activity activity, boolean isAdd);

    /**
     * 修改活动成员的安全验证
     *
     * @param membership
     */
    void updateActivityMemberValidation(ActivityMembership membership, boolean isAddMember);

    /**
     * 获取所有已经通过审核的活动
     * @return
     */
    Page<ListActivityVO> getAllActivity(PageQueryRequest page);

    boolean deleteActivitys(List<Long> ids);

}
